DROP TABLE IF EXISTS jms_dm.dm_customer_date_network_level_ticket_detail_dt ;
create external table jms_dm.dm_customer_date_network_level_ticket_detail_dt
(
    networktype          string COMMENT '网点类型,区分代理,加盟,网点',
    timetype             string COMMENT '时间类型,区分日,周,月',
    date_time            string COMMENT '日期',
    agent_code           string COMMENT '代理区code',
    agent_name           string COMMENT '代理区',
    fran_code            string COMMENT '加盟商code',
    fran_name            string COMMENT '加盟商名称',
    network_code         string COMMENT '网点编码',
    network_name         string COMMENT '网点名称',
    customer_code        string COMMENT '客户code',
    customer_name        string COMMENT '客户',
    customer_create_time string COMMENT '客户签约时间',
    first_deliver_time   string COMMENT '第一次发货时间',
    customer_level       string COMMENT '客户等级',
    ticket_quantity      int COMMENT '票量',
    equalflag            int COMMENT '判断是否是新签',
    total_ticket_num     int COMMENT '总客户数',
    total_customer_num   int COMMENT '总票数',
    dorisdt              string comment '提供doris结果表分区'
)
    COMMENT '客户在日,周,月对应代理区,加盟商,网点的客户等级和票量明细'
    STORED AS PARQUET
    LOCATION '/dw/hive/jms_dm.db/external/dm_customer_date_network_level_ticket_detail_dt'
    TBLPROPERTIES (
        'discover.partitions' = 'false',
        'parquet.column.index.access' = 'true'
        );
